package com.hqq.presentation_tier.flux.store;

import com.hqq.presentation_tier.flux.action.Action;
import com.hqq.presentation_tier.flux.action.ActionType;
import com.hqq.presentation_tier.flux.action.MenuAction;
import com.hqq.presentation_tier.flux.action.MenuItem;

/**
 * MenuStore
 * Created by heqianqian on 2017/8/17.
 */
public class MenuStore extends Store {

    private MenuItem menuItem;

    @Override
    public void onAction(Action action) {
        if (action.getType().equals(ActionType.MENU_ITEM_SELECTED)) {
            MenuAction menuAction = (MenuAction) action;
            this.menuItem = menuAction.getMenuItem();
            notifyChange();
        }
    }

    public MenuItem getMenuItem() {
        return menuItem;
    }
}
